package com.obelisco.modelo.data.pk;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.DynaProperty;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.ClassUtils;

public abstract class PK implements Serializable {
	
	public PK() {
	}

	public abstract boolean equals(Object objeto);
	public abstract int hashCode();
		
	
	/*
	public int hashCode() {
		int result = 17;
		DynaProperty atributos[] = ((DynaBean)this).getDynaClass().getDynaProperties();
		for (int i = 0; i < atributos.length; i++) {
			String nombreAtributo = atributos[i].getName();
			Object atributo = null;
			try {
				atributo = PropertyUtils.getProperty(this, nombreAtributo);
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (NoSuchMethodException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			result = 37 * result + (atributo == null ? 0 : atributo.hashCode() );
		}
		return result;
	}
	*/
  
}
